package com.hhc.appearance;

/**
 * 传统方式：创建各个子系统的对象，并直接去调用子系统(对象)相关方法，会造成调用过程混乱，没有清晰的过程。
 */
class CPU {
    void start() {
        System.out.println("CPU is starting...");
    }
}

class Memory {
    void load() {
        System.out.println("Memory is loading data...");
    }
}

class HardDrive {
    void readData() {
        System.out.println("Hard Drive is reading data...");
    }
}

public class Main {
    public static void main(String[] args) {
        System.out.println("Starting computer...");

        // 手动管理子系统的交互
        CPU cpu = new CPU();
        Memory memory = new Memory();
        HardDrive hardDrive = new HardDrive();

        cpu.start();
        memory.load();
        hardDrive.readData();

        System.out.println("Computer has started.");
    }
}